package p.sglmsn.top.ext.wx.entity;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import p.sglmsn.top.ext.wx.iface.PhysicalInterface;
import p.sglmsn.top.ext.wx.iface.ReturnInterface;

import java.util.List;

/**
 * 群组聊天的实体
 *
 * @author 王涛
 * @date 2020/12/11 13:46
 */
@NoArgsConstructor
@Data
public class GroupChatEntity implements ReturnInterface, java.io.Serializable, PhysicalInterface {


    @JsonProperty("method")
    private String method;
    @JsonProperty("myid")
    private String myid;
    @JsonProperty("pid")
    private Integer pid;
    @JsonProperty("type")
    private Integer type;
    @JsonProperty("data")
    private Data data;


    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    @NoArgsConstructor
    @lombok.Data
    public static class Data {

        @JsonProperty("wxid")
        private String wxid;
        @JsonProperty("member")
        private List<Member> member;

        @Override
        public String toString() {
            return JSON.toJSONString(this);
        }

        @NoArgsConstructor
        @lombok.Data
        public static class Member {

            @JsonProperty("wxid")
            private String wxid;
            @JsonProperty("nickName")
            private String nickName;
            @JsonProperty("nickName2")
            private String nickName2;
            @JsonProperty("img")
            private String img;
            @JsonProperty("invite")
            private String invite;
            @JsonProperty("new")
            private Integer newX;

            @Override
            public String toString() {
                return JSON.toJSONString(this);
            }
        }
    }
}
